<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>位置</title>
	<style type="text/css">
		*{
			margin: 0px;
			padding:0px;
		}

		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			padding-top: 100px;
			position: relative;
		}

		#son{
			width: 100px;
			height: 100px;
			background: #A349A4 url() 0 0 no-repeat;
			margin-left: 300px;
			position: absolute;
			top:55px;
		}
		body{
			height: 5000px;
			background: #FF7F27 url() 0 0 no-repeat;
		}
		#top{
			width: 100%;
			height: 50px;
			background: #DD3131 url() 0 0 no-repeat;
			position:fixed;
			top:0px;
			left: 0px;
			display: none;
		}
		.out{
			width: 100%;
			height: 640px; 
			position: fixed;
			overflow: hidden;
		}
		ul{
			width: 100%;
			float: left;
			position: absolute;
			top:0px;
			left: 0px;
		}

		ul li{
			width: 100%;
			height: 640px;
			float: left;
			color: #fff;
			font-size: 50px;
		}
		.box1{
			background: red url() 0 0 no-repeat;
		}
		.box2{
			background: blue url() 0 0 no-repeat;
		}
		.box3{
			background: #FFF200 url() 0 0 no-repeat;
		}
		.box4{
			background: #7092BE url() 0 0 no-repeat;
		}
		.box5{
			background: #880015 url() 0 0 no-repeat;
		}
		.box6{
			background: #7F7F7F url() 0 0 no-repeat;
		}

	</style>
	<script type="text/javascript" src="./sfq/jquery-1.7.2.js"></script>
	<script type="text/javascript">
		$(function  () {

			time = 0;

			num = 0;

			beforeTop =0;
			function run () {

				currentTop = $(window).scrollTop();

				if(currentTop>beforeTop){
					c=0;
					beforeTop =currentTop;
				}else{
					c=1;
					beforeTop =currentTop;
				}

				if(c){
					num--;
				}else{
					num++;
				}

				xbstop = num*-640;
				$('#xbs').animate({'top': (xbstop+30)+'px'},500).animate({'top': (xbstop-100)+'px'},200).animate({'top': xbstop+'px'},200);
			}

			$(window).scroll(function(event) {
				clearInterval(time);

				time = setTimeout(run, 500);
			});

			
		})
	</script>

</head>
<body>
	<div class="out">
		<ul id="xbs">
			<li class="box1">1</li>
			<li class="box2">2</li>
			<li class="box3">3</li>
			<li class="box4">4</li>
			<li class="box5">5</li>
			<li class="box6">6</li>
		</ul>
	</div>
</body>
</html>